import request from '@/utils/request'

// 查询客户列表
export function listCustomerUser(query) {
  return request({
    url: '/vanger/customerUser/list',
    method: 'get',
    params: query
  })
}

// 查询客户列表（联合）
export function listUnion(query) {
  return request({
    url: '/vanger/customerUser/listUnion',
    method: 'get',
    params: query
  })
}


// 查询客户详细（联合）
export function getInfoUnion(id) {
  return request({
    url: '/vanger/customerUser/getInfoUnion/' + id,
    method: 'get'
  })
}

// 查询客户详细
export function getCustomerUser(id) {
  return request({
    url: '/vanger/customerUser/' + id,
    method: 'get'
  })
}

// 新增客户
export function addCustomerUser(data) {
  return request({
    url: '/vanger/customerUser',
    method: 'post',
    data: data
  })
}

// 修改客户
export function updateCustomerUser(data) {
  return request({
    url: '/vanger/customerUser',
    method: 'put',
    data: data
  })
}

// 删除客户
export function delCustomerUser(id) {
  return request({
    url: '/vanger/customerUser/' + id,
    method: 'delete'
  })
}


// 用户状态修改
export function changeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/vanger/customerUser/changeStatus',
    method: 'put',
    data: data
  })
}
